﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CustomerList.ascx.cs" Inherits="webUserControl_CustomerList" %>
<asp:Panel ID="Panel1" runat="server">

<div class="code">
    <asp:Button ID="btnAddNew" runat="server" onclick="btnAddNew_Click" 
        Text="添加新客户" />
</div></asp:Panel>
<asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:LinFen %>" 
    
    
    SelectCommand="SELECT [ID], [CustomerName], [Addre], [TelPhone], [LinkMan], [YeWu], [isTotalPoint], [isOKPoint], [isTotalMoney], [isStatus], [outTime], [inTime], [CityName], [DistrictName] FROM [vw_CustomerInfo] WHERE ([CityID] = @CityID) ORDER BY [ID] DESC">
    <SelectParameters>
        <asp:CookieParameter CookieName="cCityID" Name="CityID" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource4" runat="server" 
    ConnectionString="<%$ ConnectionStrings:LinFen %>" 
    
    SelectCommand="SELECT [ID], [CustomerName], [Addre], [TelPhone], [LinkMan], [YeWu], [isTotalPoint], [isOKPoint], [isTotalMoney], [isStatus], [outTime], [inTime], [CityName], [DistrictName] FROM [vw_CustomerInfo] ORDER BY [ID] DESC">
</asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" 
    DataKeyNames="ID" Font-Size="12px" 
    ForeColor="#333333" GridLines="None" HorizontalAlign="Center" Width="100%" 
    PageSize="20" onrowcommand="GridView1_RowCommand" 
    DataSourceID="SqlDataSource3">
    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" />
    <Columns>
        <asp:BoundField DataField="ID" HeaderText="编号" InsertVisible="False" 
            ReadOnly="True" SortExpression="ID" />
        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="~/myPoints.aspx?cID={0}" 
            DataTextField="CustomerName" DataTextFormatString="{0}" HeaderText="客户名称" />
        <asp:BoundField DataField="CityName" HeaderText="城市" 
            SortExpression="CityName" />
        <asp:BoundField DataField="DistrictName" HeaderText="区域" 
            SortExpression="DistrictName" />
        <asp:BoundField DataField="Addre" HeaderText="地址" SortExpression="Addre" />
        <asp:BoundField DataField="TelPhone" HeaderText="电话" 
            SortExpression="TelPhone" />
        <asp:BoundField DataField="LinkMan" HeaderText="联络人" SortExpression="LinkMan" />
        <asp:BoundField DataField="YeWu" HeaderText="备注" SortExpression="YeWu" />
        <asp:BoundField DataField="isTotalPoint" HeaderText="总点位数" 
            SortExpression="isTotalPoint" />
        <asp:BoundField DataField="isOKPoint" HeaderText="已分配点位" 
            SortExpression="isOKPoint" />
        <asp:BoundField DataField="isTotalMoney" HeaderText="总金额" 
            SortExpression="isTotalMoney" DataFormatString="{0:f}" />
        <asp:BoundField DataField="inTime" DataFormatString="{0:d}" HeaderText="开始时间" 
            SortExpression="inTime" />
        <asp:BoundField DataField="outTime" DataFormatString="{0:d}" HeaderText="截至时间" 
            SortExpression="outTime" />
        <asp:HyperLinkField DataNavigateUrlFields="ID"  
            DataNavigateUrlFormatString="~/SearchSupplier.aspx?cID={0}" Text="分配点位" />
        <asp:TemplateField ShowHeader="False">
            <ItemTemplate>
                <asp:Button ID="Button1" runat="server" CausesValidation="True" 
                    CommandName="ShanChu" Text="删除" CommandArgument='<%# Eval("ID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:HyperLinkField DataNavigateUrlFields="ID" 
            DataNavigateUrlFormatString="~/CustomerAdd.aspx?id={0}" Text="编辑" />
    </Columns>
    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#999999" />
    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
